package com.hspedu.newData.dmsxl.数组;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * @Author: yh
 * @description: 
 * @CreateTime: 2025-05-15 
 * @Version: 1.0
 */

public class LC2900最长相邻不相等子序列Ⅰ {

    public List<String> getLongestSubsequence(String[] words, int[] groups) {
        List<String> list = new ArrayList<>();

        for (int i = 0; i < groups.length; i++) {
            if (i==groups.length - 1 || groups[i] != groups[i+1]){
                list.add(words[i]);
            }
        }

        return list;
    }
}
